from machine import ADC,Pin,SPI
import utime
import st7789
spi = SPI(0, baudrate=40000000, polarity=1, phase=0, bits=8, endia=0, sck=Pin(6), mosi=Pin(8))
display = st7789.ST7789(spi, 240, 240, reset=Pin(11,func=Pin.GPIO, dir=Pin.OUT), dc=Pin(7,func=Pin.GPIO, dir=Pin.OUT))
display.init()
utime.sleep_ms(40)
adc=ADC(Pin(12))
def yl69():
    # while 1:
    slhu=adc.read()
    utime.sleep_ms(200)
    slhu=(4092-slhu)/3292*100
    #display.fill(st7789.color565(0,0,255))
    #display.draw_string(0, 120, 'SLHumi: %.2f' % (slhu), color=st7789.color565(66, 133, 244), bg=st7789.color565(66, 133, 244), size=3, vertical=False, rotate=st7789.ROTATE_0, spacing=1)
    return slhu